package cn.com.surker.sale.dao;

import cn.com.surker.sale.entity.SaleContractSubsidy;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 销售合同补贴表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2024-07-09
 */
public interface SaleContractSubsidyDao extends BaseMapper<SaleContractSubsidy> {

    /**
     * 查询补贴是否已存在
     * @param orgId
     * @param contractId
     * @param subsidyType 补贴方式
     * @param countType 计算方式
     * @param takeTime
     * @return
     */
    SaleContractSubsidy findTakeTime(Long orgId, Long contractId, Integer subsidyType, Integer countType,
                                     Long pumpNormId, Integer additionalCountType, Date takeTime);

    /**
     * 批量新增
     * @param list
     * @return
     */
    Integer saveBatch(List<SaleContractSubsidy> list);

	List<SaleContractSubsidy> findSubsidy(Long orgId, Long conId, String takeTime);
}
